<%= section_panel 'Favorites', :width => 'single', :position => 'right' do %>
  <%= list favorites, :toolbar => {:sort_by   => [%w(Name ciName), %w(Namespace nsPath), %w(Class ciClass)],
                              :filter_by => %w(ciName nsPath ciClass)} do |builder, target| %>
    <% short_class_name = target.ci_class_name.split('.').last.downcase %>
    <% builder.attributes raw(%(ciName="#{target.ci_name}" nsPath="#{target.ns_path}" ciClass="#{short_class_name}")) %>
    <% builder.target link_to('', favorite_path(target.ci_id)) %>
    <% builder.top do %>
      <% icon_name = site_icon!(short_class_name) %>
      <%= icon_name.blank? ? image_tag(ci_class_image_url(target.ci_class_name), :class => 'icon') : icon(icon_name, nil, 'icon') %>
      <%= target.ci_name %>
    <% end %>
    <% builder.middle link_to(target.ns_path, path_to_ns(target.ns_path)) %>
  <% end %>
<% end %>
